import requests
from lxml import etree

# 1. 获取猪八戒网的网页源代码
url = 'https://weifang.zbj.com/search/service?kw=logo%E8%AE%BE%E8%AE%A1&r=1'
resp = requests.get(url)

# 2. 读入网页源代码
tree = etree.HTML(resp.text)
result1 = tree.xpath('//*[@id="__layout"]/div/div[3]/div/div[3]/div[4]/div[1]')
for i in result1:
    price = i.xpath('./div/div[3]/div[1]/span/text()')
    company = i.xpath('./div/a/div[2]/div[1]/div/text()')
    evaluation = i.xpath('./ div / a / div[2] / div[2] / span[1] /text()')

for a,b,c in zip(company,price,evaluation):
    print(a,b.strip('￥'),c)
